﻿using System.Collections.Generic;

namespace DevOnServer
{
    public struct CLevelExp
    {
        public long LevelUp;

        public long MaxExp;
    }

    public partial class CDataManager
    {
        public CLevelExp[] ExpTable = new CLevelExp[200];

        private bool _loadExpTable(string filename)
        {
            CFileReader file = new CFileReader();
            if (!file.load(filename))
            {
                CConsole.WriteLine("Can't open exp table file '{0}'", filename);
                return false;
            }

            int level = 0;
            CLevelExp exp;

            string tok;
            while (!file.end)
            {
                tok = file.getString();
                if (tok == "expCharacter")
                {
                    file.move(2);
                    while (!file.end && tok != "}")
                    {
                        file.move(-1);

                        exp.LevelUp = file.getLong();
                        file.move(2);
                        exp.MaxExp = file.getLong();

                        ExpTable[level] = exp;
                        level++;

                        tok = file.getString();
                    }
                }
            }

            return true;
        }
    }
}